<template>
  <el-scrollbar>
    <el-menu unique-opened router :default-active="$route.path" :show-timeout="200" mode="vertical" :collapse="collapsed" 
  background-color="#2b313e" text-color="#7c8493" active-text-color="rgb(154, 206, 14)">
      <el-submenu index="/system/auth/user">
        <template slot="title">
          <i class="iconfont icon-quanxian"></i>
          <span>权限管理</span>
        </template>
        <el-menu-item index="/system/auth/user">用户管理</el-menu-item>
        <el-menu-item index="/system/auth/menu">菜单管理</el-menu-item>
        <el-menu-item index="/system/auth/role">角色管理</el-menu-item>
      </el-submenu>
      <el-menu-item index="/system/rule">
        <i class="iconfont icon-kaohe1"></i>
        <span slot="title">考核细则管理</span>
      </el-menu-item>
      <el-menu-item index="/system/patrol">
        <i class="iconfont icon-fanwei"></i>
        <span slot="title">巡河有效范围管理</span>
      </el-menu-item>
      <el-menu-item index="/system/divis">
        <i class="iconfont icon-ditu"></i>
        <span slot="title">行政区划管理</span>
      </el-menu-item>
      <el-menu-item index="/system/patl">
        <i class="iconfont icon-cishu"></i>
        <span slot="title">巡河次数设置</span>
      </el-menu-item>
      <el-menu-item index="/system/log">
        <i class="iconfont icon-xitongweihu-denglurizhi"></i>
        <span slot="title">用户登陆日志</span>
      </el-menu-item>
      <el-menu-item index="/system/flk">
        <i class="iconfont icon-youqinglianjie"></i>
        <span slot="title">友情连接管理</span>
      </el-menu-item>
      <el-menu-item index="/system/set">
        <i class="iconfont icon-xitongcanshu"></i>
        <span slot="title">系统参数配置</span>
      </el-menu-item>
      <el-submenu index="/system/news/add">
        <template slot="title">
          <i class="iconfont icon-quanxian"></i>
          <span>新闻管理</span>
        </template>
        <el-menu-item index="/system/news/add">新闻添加</el-menu-item>
        <el-menu-item index="/system/news/audit">新闻审核</el-menu-item>
      </el-submenu>
      <el-menu-item index="/system/demo">
        <i class="iconfont"></i>
        <span slot="title">页面优化版demo</span>
      </el-menu-item>
      <el-menu-item index="/system/demo1">
        <i class="iconfont"></i>
        <span slot="title">弹窗和提示信息demo</span>
      </el-menu-item>
      <el-menu-item index="/system/demo2">
        <i class="iconfont"></i>
        <span slot="title">三维建模分析</span>
      </el-menu-item>
    </el-menu>
  </el-scrollbar>
</template>

<script>
export default {
  name:'systemNav',
  data(){
    return{
      collapsed:this.$store.state.collapsed,
      //loading:false,
    }
  },
  methods:{
    //折叠导航栏
    collapse:function(){
      this.collapsed=!this.collapsed;
      this.$store.state.collapsed=this.collapsed;
    },
    // handleOpen(key, keyPath) {
    //   console.log(key, keyPath);
    // },
    // handleClose(key, keyPath) {
    //   console.log(key, keyPath);
    // }
  },
  watch:{
    // //监听路由改变时的路径来去
    // '$route':function(to,from){
    //   console.log('to.path',to.path)
    //   console.log('from.path',from.path)
    // }
  }
}
</script>